<%-- 
    Document   : consultar
    Created on : 17/02/2012, 06:28:22 PM
    Author     : Gimbet
--%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
    <tiles:insert definition="mensaje"></tiles:insert>

<html:form action="/consultarArea?method=some" onsubmit="return this">


    <table>
        <tr>
            <td>Nombre</td>    
            <td>    
                <html:text property="nombre"></html:text>
            </td>
        </tr>
        <tr>
            <td> Unidad </td>
            <td>
                <html:select property="codigoUnidad" >
                    <html:option value="0"> Seleccione Unidad</html:option>
                    <html:options collection="unidades" property="codigo"  labelProperty="descripcion"/>
                </html:select> 
            </td>
        </tr>
    </table>
    <div class="buttons">
        <button type="submit" class="regular">
            <img src="interfaz/images/buscar.png" alt=""/>:
            <bean:message key="boton.buscar" />
        </button>
    </div>
</html:form>  



<logic:present name="areas">
    <div id="paginador"></div> <p>Muestra hasta 4 resultados </p>
    <div id="tableContainer" class="tableContainer">
        <table id="tablaDatos" border="0" cellpadding="0" cellspacing="0" width="100%" class="scrollTable">
            <thead class="fixedHeader" id="fixedHeader">
                <tr>
                    <th> Nombre</th>
                    <th> Unidad</th>
                </tr>
            </thead>

            <logic:iterate name="areas" id="area">
                <tbody class="scrollContent">
                    <tr>
                        <td>
                            <bean:write name="area" property="nombre"/>
                        </td>
                        <td>
                            <bean:write name="area" property="codigoUnidad"/>
                        </td>
                    </tr>
                </tbody>
            </logic:iterate>

        </table>
    </div>
</logic:present>   

<script type="text/javascript">

    var p = new Paginador(
    document.getElementById('paginador'),
    document.getElementById('tablaDatos'),
    4
);

    p.Mostrar();
</script>
